<template>
  <view class="tradeDayIncomeMain">
    <view class="tradeDayIncomeBox">
      <view class="tradeIncomeItem" v-for="(item, index) in list" :key="index">
        <view class="time">{{ item.c_day }}</view>
        <view class="incomeBox">
          <view class="item" v-for="(it,index) in item.c_info" :key="index">
           {{ it }}
          </view>
        </view>
        <u-icon class="uIcon" name="rmb" color="#f9f9f9" size="360"></u-icon>
      </view>
    </view>
  </view>
</template>
<script>
export default {
  data() {
    return {
      searchMonth: "",
      list: [],
    };
  },
  onLoad(options) {
    this.searchMonth = options.searchMonth;
    this.getDayIncome();
  },
  onPullDownRefresh(){
    this.getDayIncome();
  },
  methods: {
    getDayIncome() {
      this.$u.api
        .getTradeDayIncome({
          searchMonth: this.searchMonth
        })
        .then((res) => {
          if (res.status == 200) {
            let datas = res.result;
            datas.forEach(item=>{
              item.c_info = item.c_info.split(',')
            })
            this.list = datas;
          } else {
            this.$refs.uToast.show({
              title: "加载失败",
              type: "error",
            });
            setTimeout(() => {
              this.$u.route({
                type: "navigateBack",
              });
            }, 2000);
          }
          uni.stopPullDownRefresh();
        });
    },
  },
};
</script>
<style lang="scss">
.tradeDayIncomeBox {
  padding: 10rpx;
}
.tradeIncomeItem {
  padding:30rpx;
  border-radius: 10rpx;
  background-color: #fff;
  margin-bottom: 10rpx;
  position:relative;
  overflow:hidden;
  .uIcon{
    position:absolute;
    right:-44rpx;
    bottom:-80rpx;
  }
  .time {
    font-size: 40rpx;
    font-weight: bold;
    color: #333;
  }
  .incomeBox {
    border-left: 4rpx solid #ccc;
    margin-top:20rpx;
    padding-left: 20rpx;
    .item{
      line-height:60rpx;
      font-size:36rpx;
    }
    // .left {
    //   font-size: 32rpx;
    //   .uIcon {
    //     margin-right: 10rpx;
    //     position: relative;
    //     top: 2rpx;
    //   }
    // }
    // .right {
    //   font-size: 36rpx;
    //   font-family: "numberFont";
    //   color: #fb4535;
    // }
  }
}
</style>